
import { Loading } from "element-ui";
export function loading(that,id,time) {
    let options = {
      text: "加载中",
      spinner:'el-icon-loading',
      target:document.querySelector("#"+id)
    };
    let loadobj = Loading.service(options);
    that.$nextTick(() => {
      // 以服务的方式调用的 Loading 需要异步关闭
      setInterval(function(){
          loadobj.close();
      },time*1000)
    });
}

export function Sloading(id,time) {
  let options = {
    text: "加载中",
    spinner:'el-icon-loading',
    target:document.querySelector("#"+id)
  };
  let loadobj = Loading.service(options);
    // 以服务的方式调用的 Loading 需要异步关闭
    setInterval(function(){
        loadobj.close();
    },time*1000)
}
